<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="renderer" content="webkit">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta name="author" content="tyler chao">
  <meta name="keywords" content="keywords">
  <meta name="description" content="description">
  <title>门店自提管理</title>
  <link rel="stylesheet" href="<{$env.app.res_url}>/css/mobile.min.css">
  <link rel="stylesheet" href="<{$env.app.res_url}>/css/main.min.css">
</head>
<body>
<main id="main" class="login-layer">
  <div class="logo"><img src="<{$env.app.res_url}>/img/onex.svg" alt=""></div>
  <form action="<{$redirect_url}>" method="post" class="form" data-validator="ajax">
    <ul class="no-bullet">
      <li class="form-row">
        <div class="grid-1">
          <i class="icon-user"></i>
          <input type="text" name="uname" id="uname" required placeholder="请输入用户名">
          <span class="alert-box error">用户名必填</span>
        </div>
      </li>
      <li class="form-row">
        <div class="grid-1">
          <i class="icon-lock"></i>
          <input type="password" name="password" id="password" required placeholder="请输入密码">
          <span class="alert-box error">密码必填</span>
        </div>
      </li>
      
      <{if $show_varycode}>
      <li class="form-row">
         <div class="grid-3" style="width:25%;"><input maxlength="4" autocomplete="off" class="inputstyle-short-out" name="verifycode" id="verifycode" value="" style="padding-left:0px;"  /></div>
         <div class="grid-3" style="width:70%; padding-left:10px;"><img id="shopadminvocde" src="<{$desktop_url}>index.php?app=wap&ctl=passport&act=gen_vcode&<{$smarty.now}>" class="verifycodeimg" style="height:40px;margin-top:3px;"><a href="javascript:changeimg('shopadminvocode')" style="padding-left:5px;font-size:14px;"><{t}>点击刷新<{/t}></a></div>
      </li>
      <{/if }>
      
      <li class="form-row">
        <div class="grid-1"><button type="submit" class="primary expand but_login">登录</button></div>
      </li>
    </ul>
  </form>
</main>

<footer id="footer" class="footer fixed bottom text-center">
  <p class="version text-reverse">v1.0.0</p>
  <p class="copyright text-reverse">Copyright ©Shopex,Inc.</p>
</footer>

<script src="<{$env.app.res_url}>/js/libs.min.js"></script>
<script src="<{$env.app.res_url}>/js/mobile.min.js"></script>
<script src="<{$env.app.res_url}>/js/main.min.js"></script>

<script>
var ck = function(key){
    this.key = key;
    this.options = {
        path: '/',
        domain: false,
        duration: 30,
        secure: false,
        document: document,
        encode: true
    };
};
ck.prototype = {
    w:function(value){
            if (this.options.encode) value = encodeURIComponent(value);
            if (this.options.domain) value += '; domain=' + this.options.domain;
            if (this.options.path) value += '; path=' + this.options.path;
            if (this.options.duration){
                var date = new Date();
                date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000);
                value += '; expires=' + date.toGMTString();
            }
            if (this.options.secure) value += '; secure';
            this.options.document.cookie = this.key + '=' + value;
    },
    r:function(){
            var value = this.options.document.cookie.match('(?:^|;)\\s*' + this.key + '=([^;]*)');
            return (value) ? decodeURIComponent(value[1]) : null;
    }
};
var cukie = {
    w:function(k,v){
        var ins = new ck(k);
        ins.w(v);
    },
    r:function(k){
        var ins = new ck(k);
        return ins.r();
    },
    d:function(k){
        var ins = new ck(k);
        ins.options.duration = -1;
        ins.w('');
    }
};

$(function() {
    
    $('.but_login').on('click', function(e) {
        var autologin = document.getElementById('autologin');
        
        if(autologin.checked){
            cukie.w('autologin', 30*1440);
        }else{
            cukie.d('autologin');
        }
    });
    
    <{if $show_varycode}>
    changeimg = function(id){
        var timestamp = Date.parse(new Date());
        document.getElementById('shopadminvocde').src='<{$desktop_url}>index.php?app=wap&ctl=passport&act=gen_vcode#'+timestamp;
    }
    <{/if}>
});
</script>

</body>
</html>